package com.oig.sys.query.support;

import com.oig.sys.query.support.module.QueryExpression;
import com.oig.sys.query.support.module.SortExpression;

import java.util.List;
import java.util.Map;

public interface QuerySqlConvert {

    String select = "select ";

    String group_by =" group by ";

    String order_by =" order by " ;

    /**
     * 分页
     */
    String limitSqlCovert(List<Integer> page);

    /**
     * 排序语句段
     */
    String orderSqlCovert(QueryExpression queryExpression,Map<String, String> sort);

    /**
     * 后端默认的排序
     */
    String defaultOrderSqlCovert(List<SortExpression> orderBy);

    /**
     * group by
     */
    String groupSqlCovert(List<String> groupBy);

    /**
     * from 语句段
     */
    String fromSqlCovert(QueryExpression queryExpression);

    /**
     * 生成查询sql
     * @return  查询语句
     */
    String selectSqlCovert(QueryExpression queryExpression);

    /**
     * 生成查询条数sql
     * @return  查询语句
     */
    String countSqlCovert(QueryExpression queryExpression);

}
